3.20 \(\int \csc ^5(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=141 \[ -\frac{\left (3 a^2+30 a b+35 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac{\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac{b (6 a+7 b) \sec (e+f x)}{3 f}-\frac{(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}+\frac{b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f} \]

[Out]

-((3*a^2 + 30*a*b + 35*b^2)*ArcTanh[Cos[e + f*x]])/(8*f) - ((3*a + 7*b)^2*Cot[e + f*x]*Csc[e + f*x])/(24*f) -
((3*a^2 + 6*a*b + 7*b^2)*Cot[e + f*x]*Csc[e + f*x]^3)/(12*f) + (b*(6*a + 7*b)*Sec[e + f*x])/(3*f) + (b^2*Csc[e
 + f*x]^4*Sec[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.138497, antiderivative size = 141, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {4133, 462, 456, 453, 206} \[ -\frac{\left (3 a^2+30 a b+35 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac{\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac{b (6 a+7 b) \sec (e+f x)}{3 f}-\frac{(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}+\frac{b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^5*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-((3*a^2 + 30*a*b + 35*b^2)*ArcTanh[Cos[e + f*x]])/(8*f) - ((3*a + 7*b)^2*Cot[e + f*x]*Csc[e + f*x])/(24*f) -
((3*a^2 + 6*a*b + 7*b^2)*Cot[e + f*x]*Csc[e + f*x]^3)/(12*f) + (b*(6*a + 7*b)*Sec[e + f*x])/(3*f) + (b^2*Csc[e
 + f*x]^4*Sec[e + f*x]^3)/(3*f)

Rule 4133

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, -Dist[ff/f, Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*(ff*x)^n)^p)/(ff*x)^(n*
p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rule 462

Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^2, x_Symbol] :> Simp[(c^2*(e*x)^(
m + 1)*(a + b*x^n)^(p + 1))/(a*e*(m + 1)), x] - Dist[1/(a*e^n*(m + 1)), Int[(e*x)^(m + n)*(a + b*x^n)^p*Simp[b
*c^2*n*(p + 1) + c*(b*c - 2*a*d)*(m + 1) - a*(m + 1)*d^2*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && Ne
Q[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[m, -1] && GtQ[n, 0]

Rule 456

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[((-a)^(m/2 - 1)*(b*c - a*d)*
x*(a + b*x^2)^(p + 1))/(2*b^(m/2 + 1)*(p + 1)), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[x^m*(a + b*x^2)^(p +
1)*ExpandToSum[2*b*(p + 1)*Together[(b^(m/2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d)*x^(-m + 2))/(a + b*x^2)]
 - ((-a)^(m/2 - 1)*(b*c - a*d))/x^m, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &
& ILtQ[m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 453

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(c*(e*x)^(m
+ 1)*(a + b*x^n)^(p + 1))/(a*e*(m + 1)), x] + Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1)), In
t[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[n] ||
GtQ[e, 0]) && ((GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1])) &&  !ILtQ[p, -1]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (b+a x^2\right )^2}{x^4 \left (1-x^2\right )^3} \, dx,x,\cos (e+f x)\right )}{f}\\ &=\frac{b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}-\frac{\operatorname{Subst}\left (\int \frac{b (6 a+7 b)+3 a^2 x^2}{x^2 \left (1-x^2\right )^3} \, dx,x,\cos (e+f x)\right )}{3 f}\\ &=-\frac{\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac{b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}+\frac{\operatorname{Subst}\left (\int \frac{-4 b (6 a+7 b)-3 \left (3 a^2+6 a b+7 b^2\right ) x^2}{x^2 \left (1-x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{12 f}\\ &=-\frac{(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}-\frac{\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac{b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}-\frac{\operatorname{Subst}\left (\int \frac{8 b (6 a+7 b)+(3 a+7 b)^2 x^2}{x^2 \left (1-x^2\right )} \, dx,x,\cos (e+f x)\right )}{24 f}\\ &=-\frac{(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}-\frac{\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac{b (6 a+7 b) \sec (e+f x)}{3 f}+\frac{b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}-\frac{\left (3 a^2+30 a b+35 b^2\right ) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (e+f x)\right )}{8 f}\\ &=-\frac{\left (3 a^2+30 a b+35 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac{(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}-\frac{\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac{b (6 a+7 b) \sec (e+f x)}{3 f}+\frac{b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [A]  time = 1.89722, size = 218, normalized size = 1.55 \[ -\frac{\sec ^4(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (\frac{1}{2} \left (105 a^2+282 a b+329 b^2\right ) (\cos (e+f x)+\cos (3 (e+f x))) \csc ^4(e+f x)+96 \left (3 a^2+30 a b+35 b^2\right ) \cos ^4(e+f x) \left (\log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )\right )+\cot (e+f x) \csc ^3(e+f x) \left (\left (6 a^2+60 a b+70 b^2\right ) \cos (4 (e+f x))-3 \left (3 a^2+30 a b+35 b^2\right ) \cos (6 (e+f x))+90 a^2+132 a b-102 b^2\right )\right )}{192 f (a \cos (2 (e+f x))+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^5*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-((b + a*Cos[e + f*x]^2)^2*((90*a^2 + 132*a*b - 102*b^2 + (6*a^2 + 60*a*b + 70*b^2)*Cos[4*(e + f*x)] - 3*(3*a^
2 + 30*a*b + 35*b^2)*Cos[6*(e + f*x)])*Cot[e + f*x]*Csc[e + f*x]^3 + ((105*a^2 + 282*a*b + 329*b^2)*(Cos[e + f
*x] + Cos[3*(e + f*x)])*Csc[e + f*x]^4)/2 + 96*(3*a^2 + 30*a*b + 35*b^2)*Cos[e + f*x]^4*(Log[Cos[(e + f*x)/2]]
 - Log[Sin[(e + f*x)/2]]))*Sec[e + f*x]^4)/(192*f*(a + 2*b + a*Cos[2*(e + f*x)])^2)

________________________________________________________________________________________

Maple [B]  time = 0.069, size = 264, normalized size = 1.9 \begin{align*} -{\frac{{a}^{2}\cot \left ( fx+e \right ) \left ( \csc \left ( fx+e \right ) \right ) ^{3}}{4\,f}}-{\frac{3\,{a}^{2}\csc \left ( fx+e \right ) \cot \left ( fx+e \right ) }{8\,f}}+{\frac{3\,{a}^{2}\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{8\,f}}-{\frac{ab}{2\,f \left ( \sin \left ( fx+e \right ) \right ) ^{4}\cos \left ( fx+e \right ) }}-{\frac{5\,ab}{4\,f \left ( \sin \left ( fx+e \right ) \right ) ^{2}\cos \left ( fx+e \right ) }}+{\frac{15\,ab}{4\,f\cos \left ( fx+e \right ) }}+{\frac{15\,ab\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{4\,f}}-{\frac{{b}^{2}}{4\,f \left ( \sin \left ( fx+e \right ) \right ) ^{4} \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}+{\frac{7\,{b}^{2}}{12\,f \left ( \sin \left ( fx+e \right ) \right ) ^{2} \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}-{\frac{35\,{b}^{2}}{24\,f \left ( \sin \left ( fx+e \right ) \right ) ^{2}\cos \left ( fx+e \right ) }}+{\frac{35\,{b}^{2}}{8\,f\cos \left ( fx+e \right ) }}+{\frac{35\,{b}^{2}\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{8\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x)

[Out]

-1/4/f*a^2*cot(f*x+e)*csc(f*x+e)^3-3/8/f*a^2*csc(f*x+e)*cot(f*x+e)+3/8/f*a^2*ln(csc(f*x+e)-cot(f*x+e))-1/2/f*a
*b/sin(f*x+e)^4/cos(f*x+e)-5/4/f*a*b/sin(f*x+e)^2/cos(f*x+e)+15/4/f*a*b/cos(f*x+e)+15/4/f*a*b*ln(csc(f*x+e)-co
t(f*x+e))-1/4/f*b^2/sin(f*x+e)^4/cos(f*x+e)^3+7/12/f*b^2/sin(f*x+e)^2/cos(f*x+e)^3-35/24/f*b^2/sin(f*x+e)^2/co
s(f*x+e)+35/8/f*b^2/cos(f*x+e)+35/8/f*b^2*ln(csc(f*x+e)-cot(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.03574, size = 223, normalized size = 1.58 \begin{align*} -\frac{3 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac{2 \,{\left (3 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{6} - 5 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 8 \,{\left (6 \, a b + 7 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 8 \, b^{2}\right )}}{\cos \left (f x + e\right )^{7} - 2 \, \cos \left (f x + e\right )^{5} + \cos \left (f x + e\right )^{3}}}{48 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/48*(3*(3*a^2 + 30*a*b + 35*b^2)*log(cos(f*x + e) + 1) - 3*(3*a^2 + 30*a*b + 35*b^2)*log(cos(f*x + e) - 1) -
 2*(3*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^6 - 5*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^4 + 8*(6*a*b + 7*b^2
)*cos(f*x + e)^2 + 8*b^2)/(cos(f*x + e)^7 - 2*cos(f*x + e)^5 + cos(f*x + e)^3))/f

________________________________________________________________________________________

Fricas [B]  time = 0.537309, size = 713, normalized size = 5.06 \begin{align*} \frac{6 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{6} - 10 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 16 \,{\left (6 \, a b + 7 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 16 \, b^{2} - 3 \,{\left ({\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{7} - 2 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{5} +{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{3}\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + 3 \,{\left ({\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{7} - 2 \,{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{5} +{\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{3}\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{48 \,{\left (f \cos \left (f x + e\right )^{7} - 2 \, f \cos \left (f x + e\right )^{5} + f \cos \left (f x + e\right )^{3}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/48*(6*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^6 - 10*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^4 + 16*(6*a*b + 7
*b^2)*cos(f*x + e)^2 + 16*b^2 - 3*((3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^7 - 2*(3*a^2 + 30*a*b + 35*b^2)*cos(
f*x + e)^5 + (3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^3)*log(1/2*cos(f*x + e) + 1/2) + 3*((3*a^2 + 30*a*b + 35*b
^2)*cos(f*x + e)^7 - 2*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^5 + (3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^3)*lo
g(-1/2*cos(f*x + e) + 1/2))/(f*cos(f*x + e)^7 - 2*f*cos(f*x + e)^5 + f*cos(f*x + e)^3)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**5*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.31271, size = 713, normalized size = 5.06 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-1/192*(24*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 96*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 72*b^2*(
cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 3*a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 6*a*b*(cos(f*x + e) -
 1)^2/(cos(f*x + e) + 1)^2 - 3*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 12*(3*a^2 + 30*a*b + 35*b^2)*lo
g(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 3*(a^2 + 2*a*b + b^2 - 8*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1)
 - 32*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 24*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 18*a^2*(cos(f
*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 180*a*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 210*b^2*(cos(f*x + e
) - 1)^2/(cos(f*x + e) + 1)^2)*(cos(f*x + e) + 1)^2/(cos(f*x + e) - 1)^2 - 256*(3*a*b + 5*b^2 + 6*a*b*(cos(f*x
 + e) - 1)/(cos(f*x + e) + 1) + 9*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 3*a*b*(cos(f*x + e) - 1)^2/(cos(
f*x + e) + 1)^2 + 6*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)
^3)/f